import { BaseException } from './../app/exception/BaseException'

export class TestException extends BaseException {
  constructor(
    message: string = '测试异常',
    errorCode: number = 50000,
    details?: any
  ) {
    super(message, 500, errorCode, details)
  }
  public static async test1(ctx: any) {
    console.log(this.constructor.name, 'test1')
  }

  public test2(ctx: any) {
    console.log(this.constructor.name, 'test2')
  }
}

// 测试实例方法
console.log('测试实例方法:')
const instance = new TestException()
instance.test2(null) // 输出: TestException test2

// 测试静态方法
console.log('\n测试静态方法:')
TestException.test1(null) // 输出: TestException test1
